*Replication do-file for Antman, Francisca M. 2022.  "For Want of a Cup: The Rise of Tea in England and the Impact of Water Quality on Mortality." Forthcoming, Review of Economics and Statistics.
*See README file.  First collect data sets in README file.  Then run Initial Set up Replication.
*This do file creates the main tables in the body of the paper as well as the estimates that are graphed in the figures.


clear

*Change this:
cd "C:\Users\Tea Paper"

cap log close
log using "Replication", text replace

***********************************

import excel "SmallpoxData\Creighton1894_LondonSmallpoxData.xlsx"

sort year
save "SmallpoxData\LondonSmallpoxData.dta", replace
 
clear
**********************************

import delimited "par1851_404_elevation_slope.csv"

gen alt=elev
sum alt, detail
gen hialt=(alt>r(p50))  
gen vhialt=(alt>r(p75))
gen vloalt=(alt<=r(p25))
gen loalt=(hialt==0)
drop alt

sort hpewcode

save "par1851_404_elevation_slope.dta", replace

clear

**********************************
use "statadata\ParishMortalityAnnual.dta", clear 

sort hpewcode
merge m:1 hpewcode using "par1851_404_elevation_slope.dta"
drop _merge 
rename elevation altitude

sort hpewcode
merge m:1 hpewcode using "waterdata.dta"
drop _merge 
sort year

merge m:1 year using "LondonSmallpoxData.dta" 
drop _merge  

sort hpewcode year
merge 1:1 hpewcode year using "Parish_wages_by_regionyear.dta"  
drop _merge

compress
save "ParishMortalityAnnual&Water&SmallpoxWages.dta", replace

clear
log close


use "ParishMortalityAnnual&Water&SmallpoxWages.dta", clear
cap drop lag_tea_*  

keep if year>=1725 & year<=1834  
drop if bap==. | mar==.  | bur==. 

gen lnwage=ln(wage)
gen lnbur=ln(bur)
gen lnmar=ln(mar)
gen lnbirths=ln(bap)
gen lnpop1=ln(pop1)  
gen lnslope=ln(slope)
gen lnalt=ln(altitude)
gen lnNwaterEA=ln(NwaterEA)


gen lnlag_tea=ln(lag_tea)
gen lnlag_misc=ln(lag_misc)

*******LOGGED VARIABLES
gen lnlag_tea_lnalt=lnlag_tea*lnalt
gen lnlag_misc_lnalt=lnlag_misc*lnalt

gen lnlag_tea_lnNwaterEA=lnlag_tea*lnNwaterEA
gen lnlag_misc_lnNwaterEA=lnlag_misc*lnNwaterEA

gen lnlag_tea_nearcoast2=lnlag_tea*nearcoast2
gen lnlag_tea_market_dist=lnlag_tea*market_dist


*******NON_LOGGED VARS
gen lag_tea_alt=lag_tea*alt
gen lag_misc_alt=lag_misc*alt
gen lag_tea_nearcoast2=lag_tea*nearcoast2
gen lag_tea_market_dist=lag_tea*market_dist

gen post_tariff_altitude=post_tariff*altitude
gen post_tariff_slope=post_tariff*slope
*********
*note that post_tariff =1 if year>=1785

foreach num of numlist 1650 1700 1720 1740 1750 1760 1770{
cap drop post_`num'*
gen post_`num'=1 if year>=`num'
replace post_`num'=0 if year<`num'

gen post_`num'_lnalt=post_`num'*lnalt
gen post_`num'_alt=post_`num'*alt
}

gen hiNwaterhialt=(vhialt==1 & vhiNwaterEA==1)
gen loNwaterloalt=(vloalt==1 & vloNwaterEA==1)

foreach var of varlist loalt hialt hiNwaterEA loNwaterEA hiNwaterhialt loNwaterloalt{
gen `var'_lag_tea=`var'*lag_tea
gen `var'_lnlag_tea=`var'*lnlag_tea
gen `var'_lnlag_misc=`var'*lnlag_misc
gen post_tariff_`var'=post_tariff*`var'
}

gen londonsmallpoxdr=londonsmallpoxdeaths/londonalldeaths 
gen ln_londonsmallpoxdr=ln(londonsmallpoxdr)
gen ln_londonsmallpoxdeaths=ln(londonsmallpoxdeaths)
gen ln_londonalldeaths=ln(londonalldeaths)


/*******Adding in code for interaction graphs*/

*gen yr1705_1714=(year>=1705 & year<=1714)  
*gen yr1715_1724=(year>=1715 & year<=1724)
gen yr1725_1734=(year>=1725 & year<=1734)
gen yr1735_1744=(year>=1735 & year<=1744)
gen yr1745_1754=(year>=1745 & year<=1754)  
gen yr1755_1764=(year>=1755 & year<=1764)
gen yr1765_1774=(year>=1765 & year<=1774)
gen yr1775_1784=(year>=1775 & year<=1784)
gen yr1785_1794=(year>=1785 & year<=1794)  
gen yr1795_1804=(year>=1795 & year<=1804)
gen yr1805_1814=(year>=1805 & year<=1814)
gen yr1815_1824=(year>=1815 & year<=1824)
gen yr1825_1834=(year>=1825 & year<=1834)


foreach x of varlist loalt hialt hiNwaterEA loNwaterEA  hiNwaterhialt loNwaterloalt{
*gen `x'_yr1705_1714=(year>=1705 & year<=1714)*`x'  
*label var `x'_yr1705_1714 "`x' X Year 1705-1714"

*gen `x'_yr1715_1724=(year>=1715 & year<=1724)*`x'
*label var `x'_yr1715_1724 "`x' X Year 1715-1724"

gen `x'_yr1725_1734=(year>=1725 & year<=1734)*`x'
label var `x'_yr1725_1734 "`x' X Year 1725-1734"

gen `x'_yr1735_1744=(year>=1735 & year<=1744)*`x'
label var `x'_yr1735_1744 "`x' X Year 1735-1744"

gen `x'_yr1745_1754=(year>=1745 & year<=1754)*`x'
label var `x'_yr1745_1754 "`x' X Year 1745-1754"

gen `x'_yr1755_1764=(year>=1755 & year<=1764)*`x'
label var `x'_yr1755_1764 "`x' X Year 1755-1764"

gen `x'_yr1765_1774=(year>=1765 & year<=1774)*`x'
label var `x'_yr1765_1774 "`x' X Year 1765-1774"

gen `x'_yr1775_1784=(year>=1775 & year<=1784)*`x'
label var `x'_yr1775_1784 "`x' X Year 1775-1784"

gen `x'_yr1785_1794=(year>=1785 & year<=1794)*`x'
label var `x'_yr1785_1794 "`x' X Year 1785-1794"

gen `x'_yr1795_1804=(year>=1795 & year<=1804)*`x'
label var `x'_yr1795_1804 "`x' X Year 1795-1804"

gen `x'_yr1805_1814=(year>=1805 & year<=1814)*`x'
label var `x'_yr1805_1814 "`x' X Year 1805-1814"

gen `x'_yr1815_1824=(year>=1815 & year<=1824)*`x'
label var `x'_yr1815_1824 "`x' X Year 1815-1824"

gen `x'_yr1825_1834=(year>=1825 & year<=1834)*`x'
label var `x'_yr1825_1834 "`x' X Year 1825-1834"
}


set mat 1000


********************************************
********EVENT STUDY GRAPHS******************
********************************************

set mat 1000		
keep if year>=1725 & year<=1834 /*5 pre-periods*/
capture drop trend
gen trend=year-1724

/*********OBTAIN ESTIMATES TO GRAPH IN FIGURES 1&2: EventStudyX.dta**************/

/*************ESTIMTATES TO GRAPH IN FIGURE 1********************************/

*******************************************************************
*****************EVENT STUDY GRAPH USING 1785 YEAR--NwaterEA*****************
*******************************************************************

reg lnbur 	loNwaterEA_yr1725_1734 loNwaterEA_yr1735_1744 loNwaterEA_yr1745_1754 loNwaterEA_yr1755_1764 loNwaterEA_yr1765_1774 /*loNwaterEA_yr1775_1784 OMITTED GROUP*/ ///
			loNwaterEA_yr1785_1794 loNwaterEA_yr1795_1804 loNwaterEA_yr1805_1814 loNwaterEA_yr1815_1824 loNwaterEA_yr1825_1834  ///
			hiNwaterEA_yr1725_1734 hiNwaterEA_yr1735_1744 hiNwaterEA_yr1745_1754 hiNwaterEA_yr1755_1764 hiNwaterEA_yr1765_1774 /*hiNwaterEA_yr1775_1784 OMITTED GROUP*/ ///
			hiNwaterEA_yr1785_1794 hiNwaterEA_yr1795_1804 hiNwaterEA_yr1805_1814 hiNwaterEA_yr1815_1824 hiNwaterEA_yr1825_1834  ///
			lnpop ///
			i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy1.dta, replace) /*creates a stata data set with the estimation results from previous regression*/


/*Difference-in-Difference specification is equivalent to differencing estimates above*/

reg lnbur 	loNwaterEA_yr1725_1734 loNwaterEA_yr1735_1744 loNwaterEA_yr1745_1754 loNwaterEA_yr1755_1764 loNwaterEA_yr1765_1774 /*loNwaterEA_yr1775_1784 OMITTED GROUP*/ ///
			loNwaterEA_yr1785_1794 loNwaterEA_yr1795_1804 loNwaterEA_yr1805_1814 loNwaterEA_yr1815_1824 loNwaterEA_yr1825_1834 ///
			yr1725_1734 yr1735_1744 yr1745_1754 yr1755_1764 yr1765_1774 /*yr1775_1784 OMITTED GROUP*/ yr1785_1794 yr1795_1804 yr1805_1814 yr1815_1824 yr1825_1834 ///
			lnpop ///
			i.trend i.hpewcode i.hpewcode#c.trend*, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy2.dta, replace) /*creates a stata data set with the estimation results from previous regression*/

*******************************************************************
*****************EVENT STUDY GRAPH USING 1785 YEAR--NwaterEA  WITH BIRTHS AND MARRIAGES*****************
*******************************************************************

reg lnbur 	loNwaterEA_yr1725_1734 loNwaterEA_yr1735_1744 loNwaterEA_yr1745_1754 loNwaterEA_yr1755_1764 loNwaterEA_yr1765_1774 /*loNwaterEA_yr1775_1784 OMITTED GROUP*/ ///
			loNwaterEA_yr1785_1794 loNwaterEA_yr1795_1804 loNwaterEA_yr1805_1814 loNwaterEA_yr1815_1824 loNwaterEA_yr1825_1834  ///
			hiNwaterEA_yr1725_1734 hiNwaterEA_yr1735_1744 hiNwaterEA_yr1745_1754 hiNwaterEA_yr1755_1764 hiNwaterEA_yr1765_1774 /*hiNwaterEA_yr1775_1784 OMITTED GROUP*/ ///
			hiNwaterEA_yr1785_1794 hiNwaterEA_yr1795_1804 hiNwaterEA_yr1805_1814 hiNwaterEA_yr1815_1824 hiNwaterEA_yr1825_1834  ///
			lnbirths lnmar ///
			i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy3.dta, replace) /*creates a stata data set with the estimation results from previous regression*/


/*Difference-in-Difference specification is equivalent to differencing estimates above*/

reg lnbur 	loNwaterEA_yr1725_1734 loNwaterEA_yr1735_1744 loNwaterEA_yr1745_1754 loNwaterEA_yr1755_1764 loNwaterEA_yr1765_1774 /*loNwaterEA_yr1775_1784 OMITTED GROUP*/ ///
			loNwaterEA_yr1785_1794 loNwaterEA_yr1795_1804 loNwaterEA_yr1805_1814 loNwaterEA_yr1815_1824 loNwaterEA_yr1825_1834 ///
			yr1725_1734 yr1735_1744 yr1745_1754 yr1755_1764 yr1765_1774 /*yr1775_1784 OMITTED GROUP*/ yr1785_1794 yr1795_1804 yr1805_1814 yr1815_1824 yr1825_1834 ///
			lnbirths lnmar ///
			i.trend i.hpewcode i.hpewcode#c.trend*, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy4.dta, replace) /*creates a stata data set with the estimation results from previous regression*/


/****ESTIMATES FOR FIGURE 2*********/

*******************************************************************
*****************EVENT STUDY GRAPH USING 1785 YEAR--ALTITUDE*****************
*******************************************************************

reg lnbur 	loalt_yr1725_1734 loalt_yr1735_1744 loalt_yr1745_1754 loalt_yr1755_1764 loalt_yr1765_1774 /*loalt_yr1775_1784 OMITTED GROUP*/ ///
			loalt_yr1785_1794 loalt_yr1795_1804 loalt_yr1805_1814 loalt_yr1815_1824 loalt_yr1825_1834  ///
			hialt_yr1725_1734 hialt_yr1735_1744 hialt_yr1745_1754 hialt_yr1755_1764 hialt_yr1765_1774 /*hialt_yr1775_1784 OMITTED GROUP*/ ///
			hialt_yr1785_1794 hialt_yr1795_1804 hialt_yr1805_1814 hialt_yr1815_1824 hialt_yr1825_1834  ///
			lnpop ///
			i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy5.dta, replace) /*creates a stata data set with the estimation results from previous regression*/


/*Difference-in-Difference specification is equivalent to differencing estimates above*/

reg lnbur 	loalt_yr1725_1734 loalt_yr1735_1744 loalt_yr1745_1754 loalt_yr1755_1764 loalt_yr1765_1774 /*loalt_yr1775_1784 OMITTED GROUP*/ ///
			loalt_yr1785_1794 loalt_yr1795_1804 loalt_yr1805_1814 loalt_yr1815_1824 loalt_yr1825_1834 ///
			yr1725_1734 yr1735_1744 yr1745_1754 yr1755_1764 yr1765_1774 /*yr1775_1784 OMITTED GROUP*/ yr1785_1794 yr1795_1804 yr1805_1814 yr1815_1824 yr1825_1834 ///
			lnpop ///
			i.trend i.hpewcode i.hpewcode#c.trend*, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy6.dta, replace) /*creates a stata data set with the estimation results from previous regression*/

*******************************************************************
*****************EVENT STUDY GRAPH USING 1785 YEAR--ALTITUDE with births and marriages*****************
*******************************************************************

reg lnbur 	loalt_yr1725_1734 loalt_yr1735_1744 loalt_yr1745_1754 loalt_yr1755_1764 loalt_yr1765_1774 /*loalt_yr1775_1784 OMITTED GROUP*/ ///
			loalt_yr1785_1794 loalt_yr1795_1804 loalt_yr1805_1814 loalt_yr1815_1824 loalt_yr1825_1834  ///
			hialt_yr1725_1734 hialt_yr1735_1744 hialt_yr1745_1754 hialt_yr1755_1764 hialt_yr1765_1774 /*hialt_yr1775_1784 OMITTED GROUP*/ ///
			hialt_yr1785_1794 hialt_yr1795_1804 hialt_yr1805_1814 hialt_yr1815_1824 hialt_yr1825_1834  ///
			lnbirths lnmar ///
			i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy7.dta, replace) /*creates a stata data set with the estimation results from previous regression*/


/*Difference-in-Difference specification is equivalent to differencing estimates above*/

reg lnbur 	loalt_yr1725_1734 loalt_yr1735_1744 loalt_yr1745_1754 loalt_yr1755_1764 loalt_yr1765_1774 /*loalt_yr1775_1784 OMITTED GROUP*/ ///
			loalt_yr1785_1794 loalt_yr1795_1804 loalt_yr1805_1814 loalt_yr1815_1824 loalt_yr1825_1834 ///
			yr1725_1734 yr1735_1744 yr1745_1754 yr1755_1764 yr1765_1774 /*yr1775_1784 OMITTED GROUP*/ yr1785_1794 yr1795_1804 yr1805_1814 yr1815_1824 yr1825_1834 ///
			lnbirths lnmar ///
			i.trend i.hpewcode i.hpewcode#c.trend*, cluster(hpewcode)

parmest, label level(90 95) saving(Tables/EventStudy8.dta, replace) /*creates a stata data set with the estimation results from previous regression*/


		

keep if year>=1761 & year<=1834
cap drop trend
gen trend=year-1760
/*****************************************************************************/
/*******TABLE 1  TEA IMPORTS**********/
/*****************************************************************************/
***PANEL A--lnpop control***
*Regressions with hig and low quality variables interacted with tea imports and interaction of two measures
reg lnbur           lnpop hialt_lnlag_tea loalt_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", replace keep(lnpop hialt_lnlag_tea loalt_lnlag_tea) excel se bdec(3)
reg lnbur           lnpop loalt_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", append keep(lnpop loalt_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur           lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", append keep(lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea) excel se bdec(3)
reg lnbur           lnpop loNwaterEA_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", append keep(lnpop loNwaterEA_lnlag_tea lnlag_tea) excel se bdec(3)

reg lnbur 			lnpop hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend if hiNwaterhialt==1 |loNwaterloalt==1, cluster(hpewcode)
outreg2   			using "Tables\Table2R1.xls", append keep(lnpop hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea) excel se bdec(3)
/*Difference-in-Difference specification is equivalent to differencing estimates above*/
reg lnbur  			lnpop loNwaterloalt_lnlag_tea lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend* if hiNwaterhialt==1 |loNwaterloalt==1, cluster(hpewcode)
outreg2   			using "Tables\Table2R1.xls", append keep(lnpop loNwaterloalt_lnlag_tea lnlag_tea) excel se bdec(3)

****PANEL B****
*Regressions with hig and low quality variables interacted with tea imports and interaction of two measures WITH BIRTHS AND MARRIAGES CONTROLS
reg lnbur           lnbirths lnmar hialt_lnlag_tea loalt_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", append keep(lnbirths lnmar hialt_lnlag_tea loalt_lnlag_tea ) excel se bdec(3)
reg lnbur           lnbirths lnmar loalt_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", append keep(lnbirths lnmar loalt_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur           lnbirths lnmar hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", append keep(lnbirths lnmar hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea ) excel se bdec(3)
reg lnbur           lnbirths lnmar loNwaterEA_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table2R1.xls", append keep(lnbirths lnmar loNwaterEA_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur 			lnbirths lnmar hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend if hiNwaterhialt==1 |loNwaterloalt==1, cluster(hpewcode)
outreg2   			using "Tables\Table2R1.xls", append keep(lnbirths lnmar hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea ) excel se bdec(3)
/*Difference-in-Difference specification is equivalent to differencing estimates above*/
reg lnbur  			lnbirths lnmar loNwaterloalt_lnlag_tea lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend* if hiNwaterhialt==1 |loNwaterloalt==1, cluster(hpewcode)
outreg2   			using "Tables\Table2R1.xls", append keep(lnbirths lnmar loNwaterloalt_lnlag_tea lnlag_tea ) excel se bdec(3)


/******************************************************************************/
/***************TABLE 2 PANEL A TEA IMPORTS--drop post-1800 obs*********************/
/*****************************************************************************/
***PANEL A--***
*Regressions with hig and low quality variables interacted with tea imports and interaction of two measures
reg lnbur           lnpop hialt_lnlag_tea loalt_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend if year<=1800, cluster(hpewcode)
outreg2             using "Tables/Table3R1.xls", replace keep(lnpop hialt_lnlag_tea loalt_lnlag_tea ) excel se bdec(3)
reg lnbur           lnpop loalt_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend if year<=1800, cluster(hpewcode)
outreg2             using "Tables/Table3R1.xls", append keep(lnpop loalt_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur           lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend if year<=1800, cluster(hpewcode)
outreg2             using "Tables/Table3R1.xls", append keep(lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea ) excel se bdec(3)
reg lnbur           lnpop loNwaterEA_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend if year<=1800, cluster(hpewcode)
outreg2             using "Tables/Table3R1.xls", append keep(lnpop loNwaterEA_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur 			lnpop hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend if (hiNwaterhialt==1 & year<=1800) | (loNwaterloalt==1 & year<=1800), cluster(hpewcode)
outreg2   			using "Tables\Table3R1.xls", append keep(lnpop hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea ) excel se bdec(3)
/*Difference-in-Difference specification is equivalent to differencing estimates above*/
reg lnbur  			lnpop loNwaterloalt_lnlag_tea lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend* if (hiNwaterhialt==1 & year<=1800) | (loNwaterloalt==1 & year<=1800), cluster(hpewcode)
outreg2   			using "Tables\Table3R1.xls", append keep(lnpop loNwaterloalt_lnlag_tea lnlag_tea ) excel se bdec(3)



/******************************************************/
/******TABLE 2 PANEL B--London small pox deaths as a fraction of all London deaths*/
********************************************************/
/****Note that I made this into a death rate by adding both london small pox deaths and total London deaths****/
*Regressions with high and low quality variables interacted with tea imports and interaction of two measures
reg lnbur           ln_londonsmallpoxdr lnpop hialt_lnlag_tea loalt_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table4R1.xls", replace keep(ln_londonsmallpoxdr lnpop hialt_lnlag_tea loalt_lnlag_tea ) excel se bdec(3)
reg lnbur           ln_londonsmallpoxdr lnpop loalt_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table4R1.xls", append keep(ln_londonsmallpoxdr lnpop loalt_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur           ln_londonsmallpoxdr lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table4R1.xls", append keep(ln_londonsmallpoxdr lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea ) excel se bdec(3)
reg lnbur           ln_londonsmallpoxdr lnpop loNwaterEA_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table4R1.xls", append keep(ln_londonsmallpoxdr lnpop loNwaterEA_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur 			ln_londonsmallpoxdr lnpop hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend if hiNwaterhialt==1 |loNwaterloalt==1, cluster(hpewcode)
outreg2   			using "Tables\Table4R1.xls", append keep(ln_londonsmallpoxdr lnpop hiNwaterhialt_lnlag_tea loNwaterloalt_lnlag_tea ) excel se bdec(3)
/*Difference-in-Difference specification is equivalent to differencing estimates above*/
reg lnbur  			ln_londonsmallpoxdr lnpop loNwaterloalt_lnlag_tea lnlag_tea  i.trend i.hpewcode i.hpewcode#c.trend* if hiNwaterhialt==1 |loNwaterloalt==1, cluster(hpewcode)
outreg2   			using "Tables\Table4R1.xls", append keep(ln_londonsmallpoxdr lnpop loNwaterloalt_lnlag_tea lnlag_tea ) excel se bdec(3)



/********************************************************************************************************************************************************/
*TABLE 3--INCLUDE lnWAGES AND IMPORTS*WATERQUALITY where imports is proxy for income and INCLUDE TEA*PARISHCHARACTERISTIC to control for proximity to trade routes
 ***PANEL A--lnpop control***
*Regressions with hig and low quality variables interacted with tea imports and interaction of two measures
reg lnbur           lnwage lnpop hialt_lnlag_tea loalt_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", replace keep(lnwage lnpop hialt_lnlag_tea loalt_lnlag_tea) excel se bdec(3)
reg lnbur           lnwage lnpop loalt_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", append keep(lnwage lnpop loalt_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur           lnwage lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", append keep(lnwage lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea) excel se bdec(3)
reg lnbur           lnwage lnpop loNwaterEA_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", append keep(lnwage lnpop loNwaterEA_lnlag_tea lnlag_tea ) excel se bdec(3)


reg lnbur           lnwage hialt_lnlag_misc loalt_lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop hialt_lnlag_tea loalt_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", append keep(lnwage hialt_lnlag_misc loalt_lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop hialt_lnlag_tea loalt_lnlag_tea) excel se bdec(3)
reg lnbur           lnwage loalt_lnlag_misc lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop loalt_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", append keep(lnwage loalt_lnlag_misc lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop loalt_lnlag_tea lnlag_tea ) excel se bdec(3)

reg lnbur           lnwage hiNwaterEA_lnlag_misc loNwaterEA_lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", append keep(lnwage hiNwaterEA_lnlag_misc loNwaterEA_lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop hiNwaterEA_lnlag_tea loNwaterEA_lnlag_tea) excel se bdec(3)
reg lnbur           lnwage loNwaterEA_lnlag_misc lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop loNwaterEA_lnlag_tea lnlag_tea i.trend i.hpewcode i.hpewcode#c.trend, cluster(hpewcode)
outreg2             using "Tables/Table5R1.xls", append keep(lnwage loNwaterEA_lnlag_misc lnlag_misc lnlag_tea_nearcoast2 lnlag_tea_market_dist  lnpop loNwaterEA_lnlag_tea lnlag_tea) excel se bdec(3)

/********************************************************************************************************************************************************/

cap log close
